BIN=server client examplesslserver examplesslclient
#BIN+=tac_dll
BINO=ssl_server.o ssl_client.o debug.o examplesslclient.o examplesslserver.o

#dbus-ding-listen  dbus-ding-send

DEBUG_OBJ_FILES := \
    	debug.o 

LIB=-lssl

%.o: %.c
	gcc $(CFLAGS) -c -o $@ $<

all: $(BIN)

server: ssl_server.o  debug.o 
	gcc -o $@ ssl_server.o  debug.o $(LIB)
        
client: ssl_client.o  debug.o 
	gcc -o $@ ssl_client.o  debug.o  $(LIB)  

ocsp_staple: ocsp_staple.o debug.o 
	gcc -o $@ $<  $(LIB)

examplesslclient: examplesslclient.o debug.o 
	gcc -o $@ $<  $(LIB)
	
examplesslserver: examplesslserver.o debug.o 
	gcc -o $@ $<  $(LIB)
	
clean:
	rm -rf $(BIN) $(BINO) *.pem *.key *.crt
runs:
	./server 7838 1 172.18.135.200 cacert.pem cacert.key
runc:
	./client 172.18.135.200 7838
runes:
	@env servercert=3server.crt
	@env privatekey=3server.key
	@env serverpwd="whatever"
	@echo "cert:$$servercert key:$$privatekey pwd:$$serverpwd"
	./examplesslserver 5555 c 3 -t

runec:
	export truststore=multica3.pem
	./examplesslclient 127.0.0.1 5555 c 3 -t

info:
	echo "make runc|runs|runec|runes"
		
debug.o:debug.h	
ssl_server.o:debug.h
ssl_client.o:debug.h
examplesslclient.o:debug.h
examplesslserver.o:debug.h
